﻿using System;

using ConfExpert.Forms.Base;
using Extensions;

namespace ConfExpert
{
    public partial class TemporaryForm : XForm
    {
        public TemporaryForm()
        {
            InitializeComponent();
        }

        void btnKaydet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            gv.EndEdit();
            int count = gv.Update("RollId,OwnerId", "Roll").Rows.Count;
            ShowInfoMessage(string.Format("{0} adet kayıt güncellendi.",count));
        }

        private void TemporaryForm_Load(object sender, EventArgs e)
        {
            
            this.Text = "OwnerId Kontrol";
            txtInfo.Caption = "Owner ID'leri belirleyin.";            
            gv.Init("GetTemporaryQuery");
            gv.MakeReadOnly("OwnerId");
            gv.FormatAsNumber(1, "Qty");
            gv.AddSummary("Qty");

            gv.BestFitColumns();
            gv.Columns["OwnerId"].Width = 100;
           // gv.MakeCompulsory("OwnerId");
            btnKaydet.ItemClick += btnKaydet_ItemClick;

        }
    }
}
